<?php
class KomaSystemAdminister extends KomaBlock
{
    function main()
    {   
        global $komaUserHandler;
    
        if($komaUserHandler->isAdmin())
        {
            //$block = array();
            $menus = array();
            //$link = array();
            
            $this->Database->query("SELECT * FROM ".$this->Database->prefix('components')." WHERE hasadmin = 1");
            
            while($row = $this->Database->fetchArray())
            {
                $menus[] = array('name' => $row['name'], 'link' => KOMA_URL.'/components/'. $row['dirname'].'/admin/');
            }
    
            $this->Title = T_('Administer');
            $this->Template->File = 'administer.html';
            $this->Template->assign('menus', $menus);
            
            return true;
        }
        
        return false;
    }
}
?>
